// basic_serie.cpp

#include <quigon/basic/basic_serie.h>

using namespace std;

namespace quigon
{

template<>
string Serie<string, string>::at(const string& x0, Serie::interp_option opt) const
{
	try
	{
		map<axis_type, value_type>::const_iterator i = value.find(x0);
		if (i == value.end())
			throw invalid_argument(string("No such key: ") + x0);

		return i->second;
	}
	catch (...)
	{
		func_err("Serie<string,string>::at", x0);
		throw;
	}
}

template<>
double Serie<std::string, double>::at(const std::string& x0, Serie::interp_option opt) const
{
	try
	{
		map<axis_type, value_type>::const_iterator i = value.find(x0);
		if (i == value.end())
			throw invalid_argument(string("No such key: ") + x0);

		return i->second;
	}
	catch (...)
	{
		func_err("Serie<string,double>::at", x0);
		throw;
	}
}

}

